package com.conti.controller.admin;

import com.conti.entity.Department;
import com.conti.entity.Group;
import com.conti.result.Result;
import com.conti.service.CategoryService;
import com.conti.service.DepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 产线部门管理
 */
@RestController
@RequestMapping("admin/department")
@Api(tags = "产线部门相关接口")
@Slf4j
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;


    /**
     * 根据empno/line_leader查询产线部门
     * @param empno/line_leader
     * @return
     */
    @GetMapping("/list")
    @ApiOperation("查询部门信息")
    public Result<List<Department>> list(String empno){
        List<Department> list = departmentService.list(empno);
        return Result.success(list);
    }


    /**
     * 查询产线group
     * @param empno
     * @return
     */
    @GetMapping("/group")
    @ApiOperation("查询产线group信息")
    public Result<List<Group>> groupList(String empno){
        List<Group> list = departmentService.groupList(empno);
        return Result.success(list);
    }

}
